NTv2 File Format

The format of the grid file (NTv2) is described in the following web page:
    http://www.geom.unimelb.edu.au/gda94/UsersGuide.pdf
and
    http://www.geom.unimelb.edu.au/gda94/SoftDoc.pdf

The file consists of the following data records:
Overview Header - 176 bytes long
Sub-grid 1 Header - 176 bytes long
Sub-grid 1 node values - n bytes long
[Sub-grid 2 Header - 176 bytes long]
[Sub-grid 2 data - m bytes long]
....

The file actually consists of 16 byte records.
The Overview header consists of 11 x 16 byte records
The Sub-grid header consists of 11 x 16 byte records

The node values are stored, one per 16 byte records as four floating point values (4 bytes each).

Overview Header
Byte Type Contents Meaning
0 char(8) “NUM_OREC” field name
8 int(4) integer number of fields (16 bytes each) in overview record
12 int(4) integer 0 = padding
16 char(8) “NUM_SREC” field name
24 int(4) integer number of fields (16 bytes each) in sub-grid record
28 int(4) integer 0 = padding
32 char(8) “NUM_FILE” field name
40 int(4) integer number of sub_grids in the file
44 int(4) integer 0 = padding
48 char(8) “GS_TYPE ” field name
56 char(8) “SECONDS” shift type = units of the grid values, thus all latitudes and longitudes are stored in seconds.
64 char(8) “VERSION ” field name
72 char(8) “GEODATA” distortion type
80 char(8) “SYSTEM_F” field name
88 char(8) “GRS80 ” ‘From’ ellipsoid name
96 char(8) “SYSTEM_T” field name
104 char(8) “GRS80 ” ‘To’ ellipsoid name
112 char(8) “MAJOR_F” field name
120 double(8) double ‘From’ semi major axis
128 char(8) “MINOR_F” field name
136 double(8) double ‘From’ semi minor axis
144 char(8) “MAJOR_T” field name
152 double(8) double ‘To’ semi major axis
160 char(8) “MINOR_T” field name
168 double(8) double ‘To’ semi minor axis


Grid Header
Byte Type Contents Meaning
0 char(8) “SUBNAME” field name
8 char(8) char name of the sub-grid
16 char(8) “PARENT ” field name
24 char(8) char name of the parent grid
32 char(8) “CREATED” field name
40 char(8) char date of creation
48 char(8) “UPDATED” field name
56 char(8) char date of update
64 char(8) “S_LAT” field name
72 double(8) double lower latitude (in seconds)
80 char(8) “N_LAT” field name
88 double(8) double upper latitude (in seconds)
96 char(8) “E_LONG” field name
104 double(8) double lower longitude (in seconds)
112 char(8) “W_LONG” field name
120 double(8) double upper longitude (in seconds)
128 char(8) “LAT_INC” field name
136 double(8) double Latitude interval (in seconds)
144 char(8) “LONG_INC” field name
152 double(8) double Longitude interval (in seconds)
160 char(8) “GS_COUNT” field name
168 int(4) integer grid node count
172 int(4) dummy 0

Grid Node Value
Byte Type Contents Meaning
0 float(4) latitude corrn correction to the latitude at this node point (secs)
4 float(4) longitude corrn correction to the longitude at this node point (secs)
8 float(4) lat accouracy latitude accuracy value (secs)
12 float(4) long accouracy longitude accuracy value (secs)

accuracy values can be -1.0 if the accuracy is not known.